<?php

$_SERVER["DOCUMENT_ROOT"] = "/var/www/lottou";
include($_SERVER["DOCUMENT_ROOT"]."/db.inc.php");

$strSQL = "select * from `bet_BetType` where 1";
$RS = mysql_query($strSQL);

while($Rows = mysql_fetch_object($RS)){
	print $Rows -> ID." == ".CCCC($Rows -> Type_Value_1)." == ".CCCC($Rows -> Type_Value_3)."\n";
}


function checkBIG5_GB_ASCII($strString){

	$intLen = strlen($strString);
	$isChinese = false;
	for($i = 0; $i < $intLen; $i++){
		if(bin2hex(substr($strString, $i, 1)) >= '80'){
			$i++;
			if( bin2hex(substr($strString, $i, 1)) >= '40' && bin2hex(substr($strString, $i, 1)) <= '7e'){
				return "BIG5";
			}
			$isChinese = true;
		}
	}
	return ($isChinese)?"GB":"ASCII";
}
?>